import React, { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { ConfigProvider } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import Ext from '@/common/web_extension';
function App() {
    return <div>options</div>
}

createRoot(document.getElementById('root')!).render(
    <StrictMode>
        {/* @ts-ignore */}
        <ConfigProvider locale={zhCN}>
            <App />
        </ConfigProvider>
    </StrictMode>,
)

// 接收chrome.runtime.sendMessage发送的消息，所以要判断消息类型
// 包括：
// content 页面注入的内容脚本
// panel Ext.windows.create 打开的独立页面
// popup  chrome.action.openPopup 弹出式窗口
// side_panel 侧边栏
// service_worker 

Ext.runtime.onMessage.addListener((req: any, sender: any, sendResponse: any) => {
    console.log(req, sender, 'options接收到消息')
})